import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUserHasJobsController } from '../../../controllers';
const uctoouserHasJobsRouter = new Router();
const userHasJobsController = new uctooUserHasJobsController();

uctoouserHasJobsRouter.post('/add', requireUser, userHasJobsController.add);
uctoouserHasJobsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/user_has_jobs'), userHasJobsController.edit);
uctoouserHasJobsRouter.post('/del', requireUser, rowLevelPermission('uctoo/user_has_jobs'), userHasJobsController.delete);

//For getting userHasJobs with permission control
uctoouserHasJobsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/user_has_jobs'), userHasJobsController.getSingle);
uctoouserHasJobsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/user_has_jobs'), userHasJobsController.getMany);
uctoouserHasJobsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/user_has_jobs'), userHasJobsController.getMany);

//#endregion AutoCreateCode
export default uctoouserHasJobsRouter;
